package cn.ekuma.epos.crm.contract.model;

import cn.ekuma.data.ui.swing.AbstractDTOTableModel;

import com.openbravo.bean.crm.contract.ContractProduct;
import com.openbravo.pos.base.AppLocal;

public class ContractProductTableModel extends AbstractDTOTableModel<ContractProduct>{

	@Override
	public Object getValueAt(int rowIndex, int columnIndex) {
		ContractProduct selected=this.getObj(rowIndex);
		switch(columnIndex){
		case 0:
			return selected.getIncludeProduct().getCode();
		case 1:
			return selected.getIncludeProduct().getName();
		case 2:
			return selected.getContractPrice();
		case 3:
			return selected.getMaxPrice();
		case 4:
			return selected.getMinPrice();
		case 5:
			return selected.getContractValidityDate();
		}
		return null;
	}

	@Override
	public String[] getColumnNames() {
		return new String[]{
				AppLocal.getIntString("label.prodbarcode"),
				AppLocal.getIntString("label.prodname"),
				"合同价",
				"最高价",
				"最低价",
				"到期时间"
		};
	}

}
